package com.example.admin.testdemo.util;

import android.content.Context;
import android.util.DisplayMetrics;

public class ScreenUtil {

    /**
     * 获取屏幕宽度
     * @param context
     * @return
     */
    public static int getScreenWidth(Context context){
        int width=1080;
        DisplayMetrics dm = context.getResources().getDisplayMetrics();
        width=dm.widthPixels;
        return width;
    }
    /**
     * 获取屏幕高度
     * @param context
     * @return
     */
    public static int getScreenHeight(Context context){
        int height=1080;
        DisplayMetrics dm = context.getResources().getDisplayMetrics();
        height=dm.heightPixels;
        return height;
    }
}
